class Text(object):

    __slots__ = ('_name', '_age')

    def __init__(self, name, age):
        self._name = name
        self._age = age

    @property
    def name(self):
        return self._name

    @property
    def age(self):
        return self._age

    @name.setter
    def name(self, name):
        self._name = name

    @age.setter
    def age(self, age):
        self._age = age

    def __str__(self):
        return '名字是:%s 年龄为：%d' % (self.name, self.age)

    def __repr__(self):
        return '年龄为：%d' % self
    

s = Text('笑话', 18)
print(s)
